package me.xhy.java.springboot3.r2dbc.s05one2one.s056config;

import me.xhy.java.springboot3.r2dbc.s05one2one.s051entity.S0513Book;
import me.xhy.java.springboot3.r2dbc.s05one2one.s055converter.S055BookConverter;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.r2dbc.convert.R2dbcCustomConversions;
import org.springframework.data.r2dbc.dialect.MySqlDialect;

@Configuration
public class ConverterBookConfig {

  @Bean
  @ConditionalOnMissingBean
  public R2dbcCustomConversions bookConverter() {
    return R2dbcCustomConversions.of(MySqlDialect.INSTANCE, new S055BookConverter());
  }
}
